const path = require('path')
const fs = require('fs')
const getFileName = require('./get-filename')
let tmp = require('./tmp')
function clear(chunkCount, fileName) {
  let filename = getFileName(fileName)
  let index = 0
  let dirPath = path.join(tmp, filename)
  while (index < chunkCount) {
    let tmpfile = path.join(dirPath, index + '')
    fs.unlinkSync(tmpfile)
    index++
  }
  fs.rmdirSync(dirPath)
}
module.exports = clear

// clear(12, 'audacity-2.4.2.zip')
